package com.gcit.seniorWish.web.common.persistence.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
* 管理员表
*
* @author gaozhichang
* @date 2018-03-13 下午 1:24
*/
@TableName("system_user")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
	@TableId(value="id", type= IdType.UUID)
	private String id;

    /**
     * 账号
     */
	private String account;
    /**
     * 密码
     */
	private String password;
    /**
     * md5密码盐
     */
	private String salt;
    /**
     * 名字
     */
	private String name;

	/**
	 * 用户类型
	 */
	private Integer type;

    /**
     * 部门id
     */
    private String deptId;
    /**
     * 状态
     */
	private Integer status;

	/**
	 * 所在主体id
	 */
	private String objectId;

	/**
	 * 所在主体名称
	 */
	private String objectName;

	/**
	 * 用户所在的学校id（班级管理员，班主任使用）
	 */
	private String schoolId;

	/**
	 * 用户所在的班级id（班主任使用）
	 */
	private String classId;

	/**
	 * 数据范围
	 */
	private Integer dataScope;

	/**
	 * 创建时间
	 */
	@TableField(fill=FieldFill.INSERT)
	private Date createTime;

	/**
	 * 创建者id
	 */
	@TableField(fill= FieldFill.INSERT)
	private String createBy;

	/**
	 * 更新时间
	 */
	@TableField(fill= FieldFill.UPDATE)
	private Date modifyTime;

	/**
	 * 更新者id
	 */
	@TableField(fill= FieldFill.UPDATE)
	private String modifyBy;

	/**
	 * 删除标记
	 */
	@TableField(fill=FieldFill.INSERT)
	@TableLogic
	private Integer delFlag;

	@TableField(exist = false)
	private List<String> roleIdList;


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getObjectName() {
		return objectName;
	}

	public void setObjectName(String objectName) {
		this.objectName = objectName;
	}

	public String getSchoolId() {
		return schoolId;
	}

	public void setSchoolId(String schoolId) {
		this.schoolId = schoolId;
	}

	public String getClassId() {
		return classId;
	}

	public void setClassId(String classId) {
		this.classId = classId;
	}

	public Integer getDataScope() {
		return dataScope;
	}

	public void setDataScope(Integer dataScope) {
		this.dataScope = dataScope;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public String getModifyBy() {
		return modifyBy;
	}

	public void setModifyBy(String modifyBy) {
		this.modifyBy = modifyBy;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public List<String> getRoleIdList() {
		return roleIdList;
	}

	public void setRoleIdList(List<String> roleIdList) {
		this.roleIdList = roleIdList;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "User{" +
				"id='" + id + '\'' +
				", account='" + account + '\'' +
				", password='" + password + '\'' +
				", salt='" + salt + '\'' +
				", name='" + name + '\'' +
				", type=" + type +
				", deptId=" + deptId +
				", status=" + status +
				", objectId='" + objectId + '\'' +
				", objectName='" + objectName + '\'' +
				", dataScope='" + dataScope + '\'' +
				", createTime=" + createTime +
				", createBy=" + createBy +
				", modifyTime=" + modifyTime +
				", modifyBy=" + modifyBy +
				", delFlag=" + delFlag +
				'}';
	}
}
